package com.qwz.example;

import com.qwz.example.product.ExportBodyModel;
import com.qwz.example.product.ExportFooterModel;
import com.qwz.example.product.ExportHeaderModel;

public class Client {
    public static void main(String[] args){
        ExportBodyModel bodyModel = new ExportBodyModel();
        bodyModel.setBody("body内容");

        ExportFooterModel footerModel = new ExportFooterModel();
        footerModel.setFoot("foot内容");

        ExportHeaderModel headerModel = new ExportHeaderModel();
        headerModel.setHeader("header内容");

        Builder txtBuilder = new TxtBuilder();
        Director director = new Director(txtBuilder);
        director.construct(headerModel,bodyModel,footerModel);

        String result = txtBuilder.getResult();
        System.out.println("txt版本->"+result);


        Builder xmlBuilder = new XmlBuilder();
        Director xmlDirector = new Director(xmlBuilder);
        xmlDirector.construct(headerModel,bodyModel,footerModel);

        String xmlResult = xmlBuilder.getResult();
        System.out.println("xml版本->"+xmlResult);
    }
}
